package ch5;

import java.util.Scanner;

public class CircleTest {
    public static void main(String[] args) {
        Circle c=new Circle();
        Scanner input=new Scanner(System.in);
        System.out.println("请输入圆的半径：");
        double a=input.nextDouble();
        if(!c.setR(a)){
            System.out.println("半径输入错误！");
            return;}
        c.setR(a);
        System.out.println("面积是："+c.showArea()+"\n周长是："+c.showPerimeter());
    }
}
